#ifndef PARAM_WIDGET_H
#define PARAM_WIDGET_H

#include <QWidget>
#include <iostream>
#include <QLineEdit>
#include <QRadioButton>
#include "common/types.h"
#include "common/parameters.h"

class Airfoil_dialog;

namespace Ui {
    class Param_widget_uav;
}

class Param_widget_uav : public QWidget
{
    Q_OBJECT

public:
    explicit Param_widget_uav(QWidget *parent = 0);
    ~Param_widget_uav();
    void load_airfoil_value(QVector<Point*> point_list,QString file_name, int button_pressed);
    Airfoil_dialog *get_airfoil_dialog();
    void retranslateUi();
    bool getClosed();

    int last_button_pressed;

signals:
    void s_load_parameters(ParametersWidget *params, Airfoils_curve_map *af_reference_curve, int module);

private slots:
    void get_widget_parameters();
    void load_images();
    void set_reg_exp_default();
    void set_reg_exp_range_double(QLineEdit *lineEdit);
    void set_reg_exp_range_int(QLineEdit *lineEdit);
    void front_view_wing_clicked();
    void top_view_wing_clicked();
//    void joined_wings_clicked();
    void set_signal_buttons();
    void load_fwing_button();
    void load_bwing_button();
    void load_lwing_button();
    void load_wingtip_button();
 //   void load_empennage_button();
    void set_fwing(QString file_name);
    void set_bwing(QString file_name);
    void set_lwing(QString file_name);
    void set_wingtip(QString file_name);
//    void set_forward_wingtip(QString file_name);
//    void set_empennage(QString file_name);
    void show_airfoil_dialog();
    void control_parameteres();

    void set_range_pressed();
    void mapping_lineEdit();
private:
    Ui::Param_widget_uav *ui;
    Airfoils_curve_map *af_reference_curve;
    Airfoil_dialog *ad;
    bool control_param();
    void charge_test();
    bool valid_file(QString nameFile);
    bool closed;
    QMap<QRadioButton *, QLineEdit *> index_uavParameters;


};

#endif // PARAM_WIDGET_H
